package com.quanyan.ic.vendingMachine.dao;

import com.quanyan.ic.vendingMachine.model.InventoryStream;
import com.quanyan.ic.vendingMachine.model.ReplenishmentRecord;

/**
 * Created by zhuo.shi on 2017/8/3.
 */
public interface VmInventoryDAO {

    /**
     * 更新售货机某个货道库存
     *
     * @param vmNumber   售货机编号
     * @param grid       货道XY坐标
     * @param gridNumber 货道编号
     * @param opCount    更新库存个数 + -
     */
    boolean updateGridInventory(String vmNumber, String grid, Byte gridNumber, Integer opCount);

    /**
     * 计算某个售货机的某种商品的库存
     *
     * @param goodsId
     * @param goodsUuid
     * @return
     */
    int countVmInventoryOfGoods(String vmNumber, Integer goodsId, String goodsUuid);

    /**
     * 记录库存变更流水
     *
     * @param stream 库存更新流水信息
     */
    void insertInventoryStream(InventoryStream stream);

    /**
     * 记录补货快照
     *
     * @param record 补货快照
     */
    void insertReplenishmentRecord(ReplenishmentRecord record);
}
